package com.four.controller;

import com.four.entity.Scheduling;
import com.four.service.DeptService;
import com.four.service.SchedulingService;
import com.four.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.nio.channels.ShutdownChannelGroupException;

/**
 * @projectName: appointmentsystemfour
 * @package: com.four.controller
 * @className: SchedulingController
 * @author: ZZH
 * @description: TODO
 * @date: 2022/10/13 13:28
 * @version: 1.0
 */
@RestController
@RequestMapping("scheduling")
public class SchedulingController {
    @Autowired
    private SchedulingService schedulingService;

    //预约成功修改排班预约数量
    @GetMapping("appointment")
    public Result appointment(int schedulingId){
        return   schedulingService.appointmentSubNum(schedulingId);


    }


    //确认添加排班信息
    @PostMapping("addScheduling")
    public Result addScheduling(@RequestBody Scheduling scheduling){
       return schedulingService.addScheduling(scheduling);
    }


    //回显排班信息
    @RequestMapping("scheduling")
    public Result scheduling(@RequestParam(defaultValue = "4") Integer sectionid , @RequestParam(defaultValue = "1") Integer currentPage ,@RequestParam(defaultValue = "5") Integer pageSize){
        return schedulingService.scheduling(sectionid,currentPage,pageSize);
    }



    //查询门诊部,内科医学部,外科医学部
    @GetMapping ("findScheDept")
    public Result findScheDept(){
        return schedulingService.findScheDept();
    }

    //二级菜单
    @GetMapping("menu")
    public Result menu(){
        return schedulingService.menu();
    }



}
